Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature suggestion: Add callback on refresh to be able to modify element #60

Closed
wants to merge 2 commits into from

Conversation

bolmaster2
Copy link

Just added a simple callback function to be able to modify the time element on refresh. I use it to be able to style the date depending on the time. For example adding a class old if the time passed 10 minutes and such...

@delfuego
Copy link

Wow, this would be awesome. I was coming here to request an event that got fired whenever an element was modified; either way, it'd be great to be able to monitor modifications of the timeago element so that actions can be fired off when the modification meets whatever criteria you're looking for.

(For me, I'm using timeago to show times in the future and in the past, and am looking for a way to know when one of them crosses from the future to the past. Right now, I'm using setInterval to run a script every 500ms that looks at all the timeago elements that contain 'ago' in them, and then making sure I handle those I haven't already discovered... but there HAS to be an easier way!)

@bolmaster2 bolmaster2 closed this Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants